package com.yunxin.customui.service.evnethandlerimpl;

import cn.hutool.core.lang.UUID;
import com.yunxin.customui.bean.UIComponentConfig;
import com.yunxin.customui.myinterface.IEventHandler;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * 返回一个uuid
 *
 * @author lee
 * @date 2021/10/07
 */
@Service
public class ReturnsAUUID implements IEventHandler<UIComponentConfig,Object> {

    @Override
    public List<EventHandlerResult> eventHandle(UIComponentConfig config, Object o) {
        EventHandlerResult eventHandlerResult = new EventHandlerResult(ResultEventType.Open, UUID.randomUUID().toString());
        return Collections.singletonList(eventHandlerResult);
    }
}
